import {baseUrl} from "@/config/env";

export default () => {
    return {
        submitText: '修改',
        size: 'small',
        labelWidth: 120,
        index: true,
        indexLabel: "序号",
        menuAlign: 'center',
        menuPosition: "right",
        searchIndex: 1,
        searchIcon: true,
        permissionBtn: {
            addBtn: 'app:appVersion:add',
            editBtn: 'app:appVersion:edit',
            viewBtn: 'app:appVersion:info',
            delBtn: 'app:appVersion:delete',
        },
        column: [
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "主键",
                "prop": "id",
                "hide": true,
                "type": "input"
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "APP名称",
                "prop": "appManagerId",
                "showColumn": true,
                "type": "select",
                search: true,
                dicUrl: baseUrl + "/app/app/listAll",
                cascaderItem: ["minimumFullVersionCode"],
                cascaderChange: true,
                props: {
                    label: "appName",
                    value: "id"
                }
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "版本名称",
                "prop": "appVersionName",
                "showColumn": true,
                "searchModel": "#{8}",
                "type": "input",
                search: true,
                searchLabelWidth: 140,
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "APP版本编码号",
                "prop": "appVersionCode",
                "showColumn": true,
                "type": "number"
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "是否强制升级",
                "prop": "appForceUpdate",
                "showColumn": true,
                "type": "radio",
                searchLabelWidth: 140,
                search: true,
                dicData: [
                    {label: "否", value: 0},
                    {label: "是", value: 1},
                ]
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "APP更新类型",
                "prop": "appUpdateType",
                "showColumn": true,
                "type": "radio",
                search: true,
                searchLabelWidth: 140,
                dicData: [
                    {label: "全量更新", value: 0},
                    {label: "增量更新", value: 1},
                ]
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "最低全量版本",
                "prop": "minimumFullVersionCode",
                "showColumn": true,
                "type": "select",
                dicUrl: baseUrl + "/app/appVersion/listFullVersionByAppManageId?appManagerId={{appManagerId}}",
                dicMethod: "get",
                props: {
                    label: 'appVersionCode',
                    value: 'appVersionCode',
                },
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "安卓平台下载地址",
                "prop": "platformAndroid",
                "showColumn": true,
                type: 'upload',
                accept: "*/apk",
                limit: 1,
                propsHttp: {
                    name: 'fileName',
                    res: 'data',
                    url: 'fileUrl',
                },
                span: 24,
                action: baseUrl + "/staticResources/upload",
                showWordLimit: true,
            },
            {
                "addDisplay": true,
                "editDisplay": true,
                "label": "ios平台下载地址",
                "prop": "platformIos",
                "showColumn": true,
                type: 'upload',
                accept: "*/ipa",
                limit: 1,
                propsHttp: {
                    name: 'fileName',
                    res: 'data',
                    url: 'fileUrl',
                },
                span: 24,
                action: baseUrl + "/staticResources/upload",
                showWordLimit: true,
            },
            {
                label: "版本描述信息",
                prop: "appVersionDescribe",
                type: 'textarea',
                showColumn: false,
                searchLabelWidth: 120,
                span: 24,
                display: true,
                sqlType: 'java.lang.String',
                sqlTypeDataLength: 255,

            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "创建时间",
                "prop": "createTime",
                "hide": true,
                "type": "datetime"
            },

            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "创建人",
                "prop": "createBy",
                "hide": true,
                "type": "input"
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "修改时间",
                "prop": "updateTime",
                "hide": true,
                "type": "datetime"
            },
            {
                "addDisplay": false,
                "editDisplay": false,
                "label": "修改人",
                "prop": "updateBy",
                "hide": true,
                "type": "input"
            }
        ]

    }
}
